/*
 * @ProjectName: 编程学习
 * @Copyright:   2020 HangZhou Yiyuery Dev, Ltd. All Right Reserved.
 * @address:     微信搜索公众号「架构探险之道」获取更多资源。
 * @date:        2020/9/28 11:51 上午
 * @blog:         https://yiyuery.blog.csdn.net/
 * @description: 本内容仅限于编程技术学习使用，转发请注明出处.
 */
package pub.dsb.example.sentinel;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pub.dsb.framework.boot.rest.R;
//import pub.dsb.framework.boot.rest.R;

/**
 * <p>
 *
 * </p>
 *
 * @author Yiyuery
 * @date 2020/9/28 11:51 上午
 */
@RestController
@RequestMapping("/v1/test")
public class TestController {

    @Autowired
    TestService testService;

    @RequestMapping("/req1")
    public R<String> req1() {
        return R.ok("请求成功！");
    }

    @GetMapping("/req2")
    public String req2() {
        return "请求成功！";
    }

    @GetMapping("/hello/{name}")
    public String sayHello(@PathVariable("name") String name) {
        return testService.doTest(name);
    }
}
